import java.util.*;

class  BigHead implements Comparator<Integer>{
    @Override
    public int compare(Integer o1, Integer o2) {
        return o2.compareTo(o1);//o2实现了Comparable接口的compareTo方法
    }
}


public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        ArrayList<String> arrayList=new ArrayList<>();
 int det=0;
        while (det<6){
            String s=scanner.nextLine();
            arrayList.add(s);
            det++;
        }
        String[] strings=new String[arrayList.size()];
        for(int i=0;i<strings.length;i++){
            strings[i]=arrayList.get(i);
        }
        Arrays.sort(strings);
        System.out.println(Arrays.toString(strings));
    }


    public static void main3(String[] args) {
        int[] ints={10,9,8,7,6,5,4,3,2,1};
        PriorityQueue<Integer> priorityQueue=new PriorityQueue<>(111,new BigHead());//可传入初始容量和比较器
        for(int i=0;i<4;i++){
            priorityQueue.offer(ints[i]);
        }
        for(int i=4;i<10;i++){
            int a=priorityQueue.peek();
            if(a>ints[i]){
                priorityQueue.poll();
                priorityQueue.offer(ints[i]);
            }
        }
        System.out.println(priorityQueue);
    }
    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int m=scanner.nextInt();//行数
        int n=scanner.nextInt();
        int[][] dp=new int[m+1][n+1];
        dp[1][1]=0;
        dp[0][1]=1;

        for(int i=1;i<m+1;i++){
            for(int j=1;j<n+1;j++){
                dp[i][j]=dp[i-1][j]+dp[i][j-1];
            }
        }
        System.out.println(dp[m][n]);
    }




    public static void main2(String[] args) {
        int[] arrays={1,2,3,4,5,6,7,8,9,10};
        MyHead myHead=new MyHead();
        myHead.init(arrays);
        myHead.createHeap();
        System.out.println(Arrays.toString(myHead.elem));
        myHead.offer(11);
        System.out.println(Arrays.toString(myHead.elem));
        myHead.poll();
        myHead.show();
        func a=func.a;
        func b=func.b;
        System.out.println();
        System.out.println(a.getAdd());
        System.out.println(b.getAdd());
    }
}
